/*
 * OrderAction.java
 * 
 * Version 1.0
 *
 * 15-08-2008
 * 
 * Copyright notice
 * 
 * Modification Logs:
 *   DATE        AUTHOR      DESCRIPTION
 *  --------------------------------------------------------
 *  18-Aug-2008  Thuydtn1     Tao MenuAction Class
 */
package vn.fpt.fsoft.fcos.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import vn.fpt.fsoft.fcos.entity.UserEntity;
import vn.fpt.fsoft.fcos.util.Constant;
/**
 * This OrderAction class
 * @author DaoThiNgocThuy
 *
 */
public class OrderAction extends Action {
/**
 * This method check exising of User instance in the session and display menu.
 * 
 * @param mapping ActionMaping: The ActionMapping used to select this Login instance																										
 * @param form ActionForm: The LoginForm bean for request
 * @param request HttpServletRequest: The HTTP request that Login is processing 
 * @param response HttpServletResponse: The HTTP response that Login is creating
 * 
 * @throws Exception if the menu logic throws an exception.
 * 
 * @return Forward names to correlative actions in order input.
 */
	@Override
	public ActionForward execute (ActionMapping mapping, 
									ActionForm form, 
									HttpServletRequest request,
									HttpServletResponse response) throws Exception{
		
		//Perform casting form into an instance of OrderForm (orderForm)
		// Get UserEntity with key "SK_USER_ENTITY". 
		HttpSession session = request.getSession();
		UserEntity userEntity = (UserEntity) session.getAttribute(Constant.SK_USER_ENTITY);
		//Check  is existed in the session or not?.
		if (userEntity != null) {
			//Get processId of OrderForm
			
			// If it is empty, getting the correlative ActionForward of "init".
			
		}
		else {
			session.setAttribute(Constant.SK_ERRORCODE, Constant.MENU_101);
		}
		
		
		

				return null;
		
	}

}
